Week 9: Output Devices

For output week, I focused on lighting up an LED strip with a microcontroller. The LED strip has a pin for 5V, data, and ground and did not come with header pins, so the first step was to solder on header pins. At this point, I felt like I was getting the hang of soldering and beginning to enjoy the process.

I decided to work with a different microcontroller to get practice. This time I used the Xiao SAMD21. I reviewed the data sheet and the pinout. I also needed to solder header pins onto the microcontroller.

samd

Many tutorials were available online on how to connect and program an LED strip, so this was a good place for me to start as far as programming outputs. I used the Arduino IDE for the first time which I found to be relatively easy to use. A great feature was the ability to search for and download libraries within the IDE. This was in contrast to Thonny, which required a separate search on your browser, downloading of libraries to your computer, and then creating a new file.

arduino

I downloaded the FastLED library first as this was recommended in the tutorial. After much troubleshooting, I realized that this library was not compatible with the xiao samd21. I turned to another library, the Adafruit NeoPixel library. Fortunately, this library was noted to work with this microcontroller.

One feature of the Arduino IDE is the helpful examples that are built into the system. I used the example feature to run a "strandtest" that came with the library I downloaded. Nothing happened and I realized that I had wired things incorrectly and was missing a ground connection. After more troubleshooting, I was able to get the strandtest to work.

At this point, I wanted to learn how to code the LEDs to run according to my own desired patterns and light colors. I practiced lighting one LED at a time at different speeds. I used online tutorials and ChatGPT to help with the code base and then made changes to the code based on what I wanted.